﻿@using Utils;
@model WebUI.Models.HomeViewModel
@{
    ViewBag.Title = "Design jobs and portfolio site for designer";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@if (!Model.Identity.IsLoggedIn)
{ 
    <div class="full-pitch">
        <h1>Design jobs and portfolio site for designers.&nbsp; 
        <span><a href="/signup" class="blue-submit">Create a portfolio</a> &nbsp;</span>
        <span><a href="/job/about-posting" class="blue-submit">Post a job</a></span>
        </h1>
    </div>
}

<div></div>
<div class="mainCol">
    <div><h2>Latest Shots</h2></div>
    <div class="tabsbottom"></div>
    <div class="clear"></div>

    <div class="shotlist">
        @for (int i = 0; i < Model.LatestShotList.Count; i++)
        {
            int colCount = 3;
            var shot = Model.LatestShotList[i];
            var fullName = shot.FirstName + " " + shot.LastName;
            var divclass = string.Empty;
            var shotwrapperlastclass = string.Empty;
            if (i % colCount == colCount - 1)
            {
                divclass = "last";
                shotwrapperlastclass = "shotwrapperlast";
            }
            <div class="shotwrapper @shotwrapperlastclass">
                <div class="shot shot2 @divclass">
                    <div class="innershot">
                        <div class="image">
                            <a href="/shots/@shot.ShotID" title="@shot.Title"><img src="@shot["ShotUrl"]" alt="@shot.Title"/></a>
                        </div>
                    </div>
                </div>
                <div class="user">
                    <a href="/user/@shot.UserName" rel="contact" title="@fullName"><img class="avatar16"  src="@shot["AvatarUrl"]" alt="@fullName"/>@fullName</a>
                </div>
            </div>
        }
    </div>
    <div class="minispacer"></div>
    @*<div class="fr"><a href="/shots">More shots</a></div>*@
    <div class="spacer"></div>
    <div><h2>Latest Jobs</h2></div>
    <div class="tabsbottom"></div>
    <div class="clear"></div>
    <div class="home">
        <div class="listings">
            @foreach (var job in Model.LatestJobList)
            {
            <div>
                <a class="job-link ellipsis" href="/jobs/@job.JobID/@CommonUtilities.GetTitleInUrl(job.Title)">@job.Title.ToUpperAllFirstLetter()</a>
                <span class="employer">@job.CoName</span>
                <span class="location">@job.Location</span>
                <div class="spacer"></div>
            </div>
            }
        </div>
        <div class="minispacer"></div>
        @*<div class="fr"><a href="/jobs">More jobs</a></div>*@
    </div>

    <div class="clear"></div>
</div>

<div class="sideCol">
    <div><h2>Designer</h2></div>
    <div class="tabsbottom"></div>
    <div class="clear"></div>
    <div>
        <ul>
            <li>Build portfolio</li>
            <li>Get found</li>
            <li>Apply jobs</li>
        </ul>
        <div class="smallspacer"></div>
        <div><a class="action" href="/signup" style="float:left;">Create a portfolio</a></div>
    </div>
    <div class="largespacer"></div>
    <div><h2>Employer</h2></div>
    <div class="tabsbottom"></div>
    <div class="clear"></div>
    <div>
        Reach the best designer 
        <div class="spacer"></div>
        <div><a class="action" href="/job/about-posting" style="float:left;">Post a job</a></div>
    </div>
</div>